let app = {
    get(){
        return new Promise((resolve,reject) => {
            var xhr = null;
            if(window.XMLHttpRequest){
                xhr = new XMLHttpRequest();
            }else{
                //兼容ie6一下版本
                xhr = new ActiveXObject('Microsoft.XMLHTTP');
            }
            xhr.onreadystatechange = function(){
                if(this.readyState == 4 && this.status ==200){
                    resolve(this.responseText);
                }
            }
            xhr.open('GET','www.baidu.com',true);
            xhr.send(null);
        })
    }
}
